package com.hefei.springbootmpgenerator.code;

import com.baomidou.mybatisplus.core.toolkit.AES;

/**
 * @author caizhengjun
 * @date 2020/10/9 10:57 下午
 */
public class jiami {
    public static void main(String[] args) {
        // 生成 16 位随机 AES 密钥
        //String randomKey = AES.generateRandomKey();

        /**
         * 7cfe7ca6aaa27b7b
         */
        //System.out.println("randomKey = " + randomKey);

        String data = "root";

        // 随机密钥加密
        String result = AES.encrypt(data, "7cfe7ca6aaa27b7b");
        System.out.println("result = " + result);

        String decrypt = AES.decrypt("92ufwXRzPCiT11tJcY7JfEl5okj9j33KeYcJCEsKUUFzTdkoKPV/vQPDYt/gcEduTbKmzHrPFCBtBkvMpodkx41fMaGU9nHIQw9Fsb4VE2HQc+30XYT4e6yCuXBHsQlZ", "7cfe7ca6aaa27b7b");

        System.out.println("decrypt = " + decrypt);
    }
}
